package it.truestoryfactory.tsq.services.msg;

public class AnswerMessage extends TSMessage {
	
	public final static String TYPE = "answer";
	public final static String TIME_TAG ="time";
	public static final String IP_ADDRESS_TAG = "ip_address";
	private long time; 
	private String ipAddress;
	
	
	
	@Override
	public String toXML() {
		
		return startMessageTag("answer")+getTimeElem()+getIpAddressElem()+endMessageTag();
	}
		
	private String getTimeElem() {
		
		return "<time>"+String.valueOf(getTime())+"</time>";
	}
	
	private String getIpAddressElem() {
		
		return "<ip_address>"+getIpAddress()+"</ip_address>";
	}

	public String getIpAddress() {
		
		return ipAddress;
	}

	public long getTime() {
		return time;
		
	}

	public void setTime(long time) {
		this.time = time;
	}

	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}

}
